﻿/**
 * Copyright (C) 2012 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGuice.Inject.Spi
{
    //complete!
    /// <summary>
    /// 无操作的专用于子类化的元素访问器抽象类。所有接口的方法都简单代理到VisitOther方法
    /// </summary>
    /// <typeparam name="V"></typeparam>
    public abstract class DefaultElementVisitor<V> : IElementVisitor<V>
    {
        
        protected virtual V VisitOther(IElement element)
        {
            return default(V);
        }

        public virtual  V Visit<T>(IBinding<T> binding)
        {
            return VisitOther(binding);
        }

        public virtual V Visit(ScopeBinding binding)
        {
            return VisitOther(binding);
        }

        public virtual V Visit(TypeConverterBinding binding)
        {
            return VisitOther(binding);
        }

        public virtual V Visit(InjectionRequest request)
        {
            return VisitOther(request);
        }

        public virtual V Visit(StaticInjectionRequest request)
        {
            return VisitOther(request);
        }

        public virtual V Visit<T>(ProviderLookup<T> lookup)
        {
            return VisitOther(lookup);
        }

        public virtual V Visit<T>(MembersInjectorLookup<T> lookup)
        {
            return VisitOther(lookup);
        }

        public virtual V Visit(Message message)
        {
            return VisitOther(message);
        }

        public virtual V Visit(IPrivateElements elements)
        {
            return VisitOther(elements);
        }

        public virtual V Visit(TypeListenerBinding binding)
        {
            return VisitOther(binding);
        }

        public virtual V Visit(RequireExplicitBindingsOption option)
        {
            return VisitOther(option);
        }

        public virtual V Visit(DisableCircularProxiesOption option)
        {
            return VisitOther(option);
        }

        public virtual V Visit(InterceptorBinding binding)
        {
            return VisitOther(binding);
        }
    }
}
